#include "stdafx.h"

TimeSettings::TimeSettings(sim *_main)
	: main(_main)
{
	init_model();
}


TimeSettings::~TimeSettings(){}

void TimeSettings::init_model(){
	//0 - combobox/boolean
	//1 - spinbox
	//2 - textbox
	//3 - label
	model = new PropertiesModel(this);
	model->addItem("END TIME", 0, "s", 1, 0,"11111");
	model->addItem("DT", 0, "s", 1, 0,"2222222");
	model->addItem("SIM SPEED", 0, "", 1, 0,"3333333");
	connect(this, SIGNAL(setModelData(const int &, const int &, const QVariant &)), 
		model, SLOT(changeData(const int &, const int &, const QVariant &)));

	connect(model, SIGNAL(ItemChanged(const int &, const int &, const QVariant &)),
		this, SLOT(getModelData(const int &, const int &, const QVariant &)));

	connect(model, SIGNAL(update()), this, SLOT(updateProperties()));
}


void TimeSettings::getModelData(const int &parent_row, const int &row, const QVariant &value){

}

void TimeSettings::updateProperties(){
	main->properties->setItemDelegate(new Delegate(main));
}
